﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    x:Class="QDP.Platform.Loader.SplasnScreen"
    mc:Ignorable="d">
    <UserControl.Resources>
        <Storyboard x:Name="RotateLoading" RepeatBehavior ="Forever"/>
        <Storyboard x:Name="HideLayoutRoot">
            <DoubleAnimation Storyboard.TargetName="LayoutRoot"
                             Storyboard.TargetProperty ="Opacity"
                             To ="0" Duration ="0:0:0.3" />
        </Storyboard>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="LoadState">
                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0:0:0.1">
                        <VisualTransition.GeneratedEasingFunction>
                            <BackEase EasingMode="EaseInOut"/>
                        </VisualTransition.GeneratedEasingFunction>
                    </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="LoadPart"/>
                <VisualState x:Name="RequestUser">
                    <Storyboard>
                        <DoubleAnimation Duration="0" To="90"
                                         Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"
                                         Storyboard.TargetName="rectangle"/>
                        <ColorAnimation Duration="0" To="#FF00E2FF"
                                        Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                                        Storyboard.TargetName="rectangle"/>
                        <DoubleAnimation Duration="0" To="90"
                                         Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)"
                                         Storyboard.TargetName="PercentageCounter"/>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="RequestConfig">
                    <Storyboard>
                        <DoubleAnimation Duration="0" To="180"
                                         Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"
                                         Storyboard.TargetName="rectangle"/>
                        <ColorAnimation Duration="0" To="#FFE6FF00"
                                        Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                                        Storyboard.TargetName="rectangle"/>
                        <DoubleAnimation Duration="0" To="90"
                                         Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)"
                                         Storyboard.TargetName="PercentageCounter"/>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Grid Width="300" Height="50">
            <Border BorderBrush="#FF646464" BorderThickness="1" CornerRadius="3">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFE0E0E0" Offset="1"/>
                        <GradientStop Color="#FFE4E4E4"/>
                        <GradientStop Color="Silver" Offset="0.491"/>
                    </LinearGradientBrush>
                </Border.Background>
            </Border>
            <Rectangle x:Name="rectangle" Fill="#FFF4F4F5" HorizontalAlignment="Left" Width="90"
                       VerticalAlignment="Bottom" Height="5" Stroke="#FFDEDEDE" Margin="5,0,0,1"
                       RenderTransformOrigin="0.5,0.5">
                <Rectangle.RenderTransform>
                    <CompositeTransform/>
                </Rectangle.RenderTransform>
            </Rectangle>
            <TextBlock x:Name="PercentageCatalog" HorizontalAlignment="Left" FontFamily="Arial,SimSun"
                       TextWrapping="Wrap" Margin="5,0,0,0" FontSize="14" VerticalAlignment="Center"/>
            <TextBlock x:Name="PercentageName" HorizontalAlignment="Left" FontFamily="Arial,SimSun"
                       TextWrapping="Wrap" VerticalAlignment="Bottom" Margin="5,0,0,5" FontSize="9"/>
            <TextBlock x:Name="PercentageCounter" HorizontalAlignment ="Right"
                       FontFamily ="Trebuchet MS" FontSize ="29.333" Foreground ="#7CFFFFFF"
                       Text ="0%" Margin ="0" VerticalAlignment="Bottom" >
                <TextBlock.Projection>
                    <PlaneProjection/>
                </TextBlock.Projection>
                <TextBlock.Effect>
                    <DropShadowEffect BlurRadius="1" ShadowDepth="1"/>
                </TextBlock.Effect>
            </TextBlock>
        </Grid>
    </Grid>
</UserControl>
